using System;
using System.Data.Entity.ModelConfiguration;
using System.Data.Common;
using System.Data.Entity;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using DomainLayer.Data.Entities;

namespace Infrastructure.Data.Mapping
{
	public class MyLogMap : EntityTypeConfiguration<MyLog>
	{
		public MyLogMap()
		{
			// Primary Key
			this.HasKey(t => t.Id);

			// Properties
			this.Property(t => t.Thread)
				.HasMaxLength(225);
				
			this.Property(t => t.Level)
				.HasMaxLength(50);
				
			this.Property(t => t.Logger)
				.HasMaxLength(225);
				
			this.Property(t => t.Message)
				.HasMaxLength(2000);
				
			// Table & Column Mappings
			this.ToTable("MyLog");
			this.Property(t => t.Id).HasColumnName("Id");
			this.Property(t => t.Date).HasColumnName("Date");
			this.Property(t => t.Thread).HasColumnName("Thread");
			this.Property(t => t.Level).HasColumnName("Level");
			this.Property(t => t.Logger).HasColumnName("Logger");
			this.Property(t => t.Message).HasColumnName("Message");
		}
	}
}

